1. Field of the Invention
This invention relates to software applications and in particular, to improving inlining using stack trace cache-based dynamic profiling.
2. Description of the Related Art
Many modern software languages, such as Java, C#, and C++ use procedures and functions, also called methods, to act as a semantic abstraction boundary, so that the programs may be divided into different units for easier maintenance and development. Object Oriented languages, such as Java, C#, and C++, provide a programming way in which procedure calls are frequent and procedure sizes are small. The method might be the encapsulation of one functionality, and it can be overridden with a new implementation, resulting in the explosion of call sites and leads to performance penalties. Stated differently, writing modular programs causes penalties, and one way to reduce such penalties is by procedure integration, also called inlining. Inlining is a well-known compile-time optimization technique to improve the execution performance of programs by replacing or duplicating a procedure call with the body of the called procedure.
Many attempts have been made to improve inlining, particularly with regard to Just-In-Time (JIT) compilers in order to get more run time benefits. For example, inlining plays an important factor in JIT complied (JITted) code performance, which is widespread with regard to overall performance of desktop and server/enterprise workloads. JITted code refers to the code generated on the fly by a JIT compiler. Although inlining is a well known technique to improve the execution performance of statically compiled software applications, the methods and systems available today do not efficiently reduce runtime overhead, or minimize unwinding overhead by using stack trace cache, or improve processor performance, particularly with regard to JITted code.
One of the methods available today is instrument profiling, i.e., to add instrumentation code, such as some profiling code, at the entry of methods to collect call site information, such as counter, and caller-callee relationship. However, with instrument profiling, the original code is polluted and performance is degraded, because of the extra/foreign code being added to the original code. Furthermore, instrument profiling is often used only with base line compilers.
Another method for improving inlining available today is sample profiling. Typically, sample profiling uses some kind for a meter or other hardware-assisted monitoring methods to sample instruction pointers and insert the instruction pointers into a database to find which instruction pointer belongs to which corresponding method to determine which method is hot. Whether a method is hot may depend on the frequency of a caller invoking its callee, and a large enough frequency may classify the method as hot. However, sample profiling is limited only to determining hot methods, but cannot find the specific caller-callee pair that is hot as there may be many callers calling the hot method.
Methods, systems, and techniques available today are obtrusive and/or do not provide accurate and efficient inlining as they fail to determine hot caller-callee relationships. Furthermore, the methods, systems, and techniques available today do not efficiently reduce runtime overhead, minimize unwinding overhead, or improve processor performance.